﻿
#region Usings

using PolyGameEngine.GamePieces.Common;
using PolyGameEngine.Tools;

using FarseerPhysics.Dynamics;
using FarseerPhysics.Factories;

using Microsoft.Xna.Framework;

#endregion

namespace PolyGameEngine.GamePieces
{
    public class RectangleEffectTile : EffectTile
    {
        public Fixture effectFixture
        {
            get
            {
                return body.FixtureList[1];
            }
        }

        #region Constructors
        public RectangleEffectTile(PhysicsGame PhysicsGame, World World, Material Material, Vector2 Position, float Rotation, Vector2 EffectOffset, int Width, int Height, int EffectWidth, int EffectHeight, float DrawingDepth, int saveLineIndex, string GPID)
            : base(PhysicsGame, World, Material, Position,Rotation, Width, Height, DrawingDepth, saveLineIndex, GPID)
        {
            FixtureFactory.AttachRectangle(ConvertToSim(EffectWidth), ConvertToSim(EffectHeight), 1, ConvertToSim(EffectOffset), body);
            effectFixture.IsSensor = true;

            effectFixture.OnCollision += HandleDefaultEffect;
            effectFixture.OnSeparation += HandleDefaultAfterEffect;

        }


        public override void Effect()
        {
        }

        #endregion



    }
}
